 <template>
  <div class="rating_container">
    <section class="star_container">
      <span class="iconfont icon-jinbi1" v-for="num in 5" :key="num"></span>
    </section>
    <div :style="'width:' + rating*2/5 + 'rem'" class="star_overflow">
      <section class="star_container">
        <span class="iconfont icon-zuanshi" v-for="num in 5" :key="num"></span>
      </section>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  props: ["rating"]
};
</script>

<style lang="scss" scoped>
@import "../../style/mixin";
.rating_container {
  position: relative;
  top: 0.47px;
  @include wh(47px, 9.36px);
  .star_overflow {
    overflow: hidden;
    position: relative;
    height: 100%;
  }
  .star_container {
    position: absolute;
    display: flex;
    width: 47px;
    height: 9px;
    top: -0.4px;
    left: -0.4px;
    .grey_fill {
      fill: #d1d1d1;
    }
    .orange_fill {
      fill: #ff9a0d;
    }
  }
}
</style>
